package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.LagouSecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author : liuchangling
 * @Descrition :测试单个用户的多个方法访问权限
 * @Date： Created in 11:32 上午 2021/10/14
 */
@LagouController
@LagouSecurity({"zhangsan","lisi"})
@LagouRequestMapping("/demo1")
public class DemoController2 {
    @LagouAutowired
    private IDemoService demoService;

    @LagouSecurity("wangwu")
    @LagouRequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        return demoService.get(name);
    }

    @LagouSecurity("zhaoliu")
    @LagouRequestMapping("/query1")
    public String query1(HttpServletRequest request, HttpServletResponse response,String name) {
        return demoService.get(name);
    }
}
